<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
        <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no;">
		<title>首页--恒创后台管理系统</title>
		<link href="__CSS__/bootstrap.css" rel="stylesheet" type="text/css" />
        <link href="__ADMIN__/css/style.css" rel="stylesheet" type="text/css"/>
        <script type="text/javascript" src="__JS__/echarts.min.js"></script>
        <style type="text/css">
            .textColor{
                color: white;
                text-align: center;
            }
        </style>
	</head>
	<body>
        <nav class="navbar navbar-default navbar-fixed-top">
            <div class="container">
                <div class="container-fluid">
                    <div class="navbar-header">
                        <!--<a class="navbar-brand" style="color: #3398DB" href="#">恒创后台管理系统</a>-->
                        <a class="navbar-brand" href="#">恒创后台管理系统</a>
                    </div>
                </div>
            </div>
        </nav>
		<div class="container">
            <div class="row">
                <div class="col-md-3 col-lg-3 col-sm-3">
                    <div class="list-group">
                        <a href="#" class="list-group-item active">
                            首页
                        </a>
                        <a href="introduce.html" class="list-group-item">
                            系统介绍
                        </a>
                        <a href="userManage.html" class="list-group-item">
                            用户管理
                        </a>
                        <a href="#" class="list-group-item">
                            设备管理
                        </a>
                        <a href="userMap.html" class="list-group-item">
                            用户地图
                        </a>
                        <a href="#" class="list-group-item">
                            数据统计分析
                        </a>
                    </div>
                </div>
                <div class="col-md-9 col-lg-9 col-sm-9">

                    <div class="row">
                        <div class="col-sm-9 col-md-6">
                            <div class="thumbnail">
                                <h4>各型设备比例</h4>
                                <div class="caption">
                                    <div id="deviceOnlineRatio" class="chartContainer"></div>
                                </div>
                            </div>
                        </div>
                        <div class="col-sm-9 col-md-6">
                            <div class="thumbnail">
                                <h4>各类用户比例</h4>
                                <div class="caption">
                                    <div id="userOnlineRatio" class="chartContainer"></div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-9 col-md-6">
                            <div class="thumbnail">
                                <h4>近期设备上线数量</h4>
                                <div class="caption">
                                    <div id="recencyDeviceOnlineNum" class="chartContainer"></div>
                                </div>
                            </div>
                        </div>
                        <div class="col-sm-9 col-md-6">
                            <div class="thumbnail">
                                <h4>近期用户上线数量</h4>
                                <div class="caption">
                                    <div id="recencyUserOnlineNum" class="chartContainer"></div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-6 col-md-3">
                            <a href="#" class="btn btn-primary thumbnail" style="background-color: #337ab7">
                                <h4 class="textColor">666</h4>
                                <h4 class="textColor">在线设备</h4>
                            </a>
                        </div>
                        <div class="col-sm-6 col-md-3">
                            <a href="#" class="btn btn-warning thumbnail" style="background-color: #f0ad4e">
                                <h4 class="textColor">233</h4>
                                <h4 class="textColor">离线设备</h4>
                            </a>
                        </div>
                        <div class="col-sm-6 col-md-3">
                            <a href="" class="btn btn-success thumbnail" style="background-color: #5cb85c">
                                <h4 class="textColor">888</h4>
                                <h4 class="textColor">新增用户</h4>
                            </a>
                        </div>
                        <div class="col-sm-6 col-md-3">
                            <a href="#" class="btn btn-info thumbnail" style="background-color: #5bc0de">
                                <h4 class="textColor">668</h4>
                                <h4 class="textColor">今日登录</h4>
                            </a>
                        </div>
                    </div>
                    <div class="panel panel-default">
                        <div class="panel-body">
                            <p align="center">
                                Copyright © 2017.HengChuang Team All rights reserved.Powered by
                                <a href="http://115.159.151.135/" target="_blank" title="Xwen">Xwen</a>
                            </p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
	</body>
</html>
<script type="text/javascript">
    // 基于准备好的dom，初始化echarts实例
    var myChart0 = echarts.init(document.getElementById('deviceOnlineRatio'));
    var myChart1 = echarts.init(document.getElementById('userOnlineRatio'));
    var myChart2 = echarts.init(document.getElementById('recencyDeviceOnlineNum'));
    var myChart3 = echarts.init(document.getElementById('recencyUserOnlineNum'));

    var option0 = {
//        title : {
//            text: '各型设备数量分布',
//            subtext: '消防监测',
//            x:'center'
//        },
        tooltip : {
            trigger: 'item',
            formatter: "{a} <br/>{b} : {c} ({d}%)"
        },
        legend: {
            orient: 'vertical',
            left: 'left',
            data: ['led','电机','检测','指示灯','嗅探器']
        },
        series : [
            {
                name: '设备类型',
                type: 'pie',
                radius : '55%',
                center: ['50%', '60%'],
                data:[
                    {value:335, name:'led'},
                    {value:310, name:'电机'},
                    {value:234, name:'检测'},
                    {value:135, name:'指示灯'},
                    {value:1548, name:'嗅探器'}
                ],
                itemStyle: {
                    emphasis: {
                        shadowBlur: 10,
                        shadowOffsetX: 0,
                        shadowColor: 'rgba(0, 0, 0, 0.5)'
                    }
                }
            }
        ]
    };

    var option1 = {
//        title:{
//            text:'各类用户比例',
//            subtext:'平台管理',
//            x:'center'
//        },
        tooltip: {
            trigger: 'item',
            formatter: "{a} <br/>{b}: {c} ({d}%)"
        },
        legend: {
            orient: 'vertical',
            x: 'left',
            data:['一级用户','二级用户','三级用户']
        },
        series: [
            {
                name:'用户类型',
                type:'pie',
                radius: ['50%', '70%'],
                avoidLabelOverlap: false,
                label: {
                    normal: {
                        show: false,
                        position: 'center'
                    },
                    emphasis: {
                        show: true,
                        textStyle: {
                            fontSize: '30',
                            fontWeight: 'bold'
                        }
                    }
                },
                labelLine: {
                    normal: {
                        show: false
                    }
                },
                data:[
                    {value:335, name:'一级用户'},
                    {value:310, name:'二级用户'},
                    {value:234, name:'三级用户'}
                ]
            }
        ]
    };

    var option2 = {
//        title:{
//            text:'近期设备上线数量',
//        },
        color: ['#3398DB'],
        tooltip : {
            trigger: 'axis',
            axisPointer : {            // 坐标轴指示器，坐标轴触发有效
                type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
            }
        },
        grid: {
            left: '3%',
            right: '4%',
            bottom: '3%',
            containLabel: true
        },
        xAxis : [
            {
                type : 'category',
                data : ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
                axisTick: {
                    alignWithLabel: true
                }
            }
        ],
        yAxis : [
            {
                type : 'value'
            }
        ],
        series : [
            {
                name:'设备数量',
                type:'bar',
                barWidth: '60%',
                data:[10, 52, 200, 334, 390, 330, 220]
            }
        ]
    };

    var option3 = {
//        title: {
//            text: '近期用户上线数量'
//        },
        tooltip : {
            trigger: 'axis',
            axisPointer: {
                type: 'cross',
                label: {
                    backgroundColor: '#6a7985'
                }
            }
        },
        legend: {
            data:['一级用户','二级用户','三级用户']
        },
        grid: {
            left: '3%',
            right: '4%',
            bottom: '3%',
            containLabel: true
        },
        xAxis : [
            {
                type : 'category',
                boundaryGap : false,
                data : ['周一','周二','周三','周四','周五','周六','周日']
            }
        ],
        yAxis : [
            {
                type : 'value'
            }
        ],
        series : [
            {
                name:'一级用户',
                type:'line',
                stack: '总量',
                areaStyle: {normal: {}},
                data:[120, 132, 101, 134, 90, 230, 210]
            },
            {
                name:'二级用户',
                type:'line',
                stack: '总量',
                areaStyle: {normal: {}},
                data:[220, 182, 191, 234, 290, 330, 310]
            },
            {
                name:'三级用户',
                type:'line',
                stack: '总量',
                label: {
                    normal: {
                        show: true,
                        position: 'top'
                    }
                },
                areaStyle: {normal: {}},
                data:[150, 232, 201, 154, 190, 330, 410]
            }
        ]
    };
    // 使用刚指定的配置项和数据显示图表。
    myChart0.setOption(option0);
    myChart1.setOption(option1);
    myChart2.setOption(option2);
    myChart3.setOption(option3);
</script>
